
<div class="container">
<?php
if (empty($datalist)) {
	echo "<h3>Data masih kosong!</h3>";
}
else {
?>
			<table id="my_data_list" class="table table-striped table-bordered" cellspacing="0" width="100%">
				<thead>
					<tr>
						<th>No</th>
						<th>NIK Anggota</th>
						<th>Bagian</th>
						<th>Departemen</th>
						<th>Tanggal</th>
						<th>Aksi</th>
					</tr>
				</thead>
				<tbody>
				<?php
				$no = 1;
				foreach ($datalist as $data):
				if($this->session->userdata('departemen')== $data->DEPARTEMEN)
				{
				?>
					<tr>
						<td><?php echo $no; ?></td>
						<td><?php echo $data->ANGGOTA." ".$data->ANGGOTA2; ?></td>
						<td><?php echo $data->BAGIAN; ?></td>
						<td><?php echo $data->DEPARTEMEN; ?></td>
						<td><?php echo $data->TANGGAL; ?></td>
						<td>
						<?php
						if($this->session->userdata('role')==5)
						{
						?>
						<a href="<?php echo base_url();?>index.php/pembul/ubah/<?php echo $data->ID_LAPORAN; ?>">Ubah</a> | <a href="<?php echo base_url();?>index.php/pembul/hapus/<?php echo $data->ID_LAPORAN; ?>">Hapus</a>  | <a href="<?php echo base_url();?>index.php/pembul/detail/<?php echo $data->ID_LAPORAN; ?>">Detail</a>
						<?php
						}
						else if($this->session->userdata('role')==1)
						{
							if(date('d')<11)
							{
						?>
						<a href="<?php echo base_url();?>index.php/pembul/ubah/<?php echo $data->ID_LAPORAN; ?>">Ubah</a> | <a href="<?php echo base_url();?>index.php/pembul/hapus/<?php echo $data->ID_LAPORAN; ?>">Hapus</a>  | <a href="<?php echo base_url();?>index.php/pembul/detail/<?php echo $data->ID_LAPORAN; ?>">Detail</a>
						<?php
							}
							else if(date('d')>10)
							{
						?>
						<a href="<?php echo base_url();?>index.php/pembul/detail/<?php echo $data->ID_LAPORAN; ?>">Detail</a>
						<?php
							}
						}
						else if($this->session->userdata('role')==2)
						{ 
							if(date('d')<10)
							{
						?>
						<a href="<?php echo base_url();?>index.php/pembul/detail/<?php echo $data->ID_LAPORAN; ?>">Detail</a>
						<?php
							}
							else
							{
							?>
						<a href="<?php echo base_url();?>index.php/pembul/ubah/<?php echo $data->ID_LAPORAN; ?>">Ubah</a> | <a href="<?php echo base_url();?>index.php/pembul/detail/<?php echo $data->ID_LAPORAN; ?>">Detail</a>
							<?php
							}
						}
						else if($this->session->userdata('role')==3)
						{
							if($data->PENGAWAS)
							{
						?>
						<a href="<?php echo base_url();?>index.php/pembul/ubah/<?php echo $data->ID_LAPORAN; ?>">Ubah</a> | <a href="<?php echo base_url();?>index.php/pembul/detail/<?php echo $data->ID_LAPORAN; ?>">Detail</a>
						<?php
							}
							else
							{
						?>
						<a href="<?php echo base_url();?>index.php/pembul/detail/<?php echo $data->ID_LAPORAN; ?>">Detail</a>
						<?php
							}
						}
						else if($this->session->userdata('role')==4)
						{
						?>
						<a href="<?php echo base_url();?>index.php/pembul/detail/<?php echo $data->ID_LAPORAN; ?>">Detail</a>
						<?php
						}
						?>
						</td>
					</tr>
				<?php
				$no++;
				}
				endforeach;
				?>
				</tbody>
			</table>
<?php
}
?>
		</div>
		</body></html>